package com.chapter01exercise.homework05;

/**
 * @Author 小闽
 * @Date 2024/8/16 16:38
 * @PackageName: com.chapter01exercise.homework5
 * @ClassName: Scientist
 * @Description: 科学家类
 * @Version 1.0
 */
public class Scientist extends Employee {
    private double annualSalary;
    /**
     * 构造器
     * @param name
     * @param basic_salary
     * @param
     */
    public Scientist(String name, double basic_salary) {
        super(name, basic_salary);
    }

    public double getAnnualSalary() {
        return annualSalary;
    }

    public void setAnnualSalary(double annualSalary) {
        this.annualSalary = annualSalary;
    }
    /**
     * 重写父类的countAnnualSalary()方法
     */
    @Override
    public double countAnnualSalary() {
        System.out.println("科学家：" + getName() + "\n" + "全年工资为：");
        return super.countAnnualSalary() + getAnnualSalary();
    }
}
